package inputs;

import processing.core.PApplet;
import processingHandling.PAppletWrapper;

/**
 * Class for handling the Green data of a PixelInput.
 * Bound to a PixelInput object
 * Uses a PAppletWrapper to access green(colorVal) function
 * 
 * @author Dylan James
 *
 */
public class PixelInputGreen extends Input{
	private PApplet pApplet; // The PAppletWrapper this is bound to
	private PixelInput input; // The PixelInput this is bound to
	private int value; // The current value
	
	protected PixelInputGreen(PApplet pApplet, PixelInput input){
		this.pApplet = pApplet;
		this.input = input;
		
		this.min = 0;
		this.max = 255;
	}
	@Override
	protected void Update() {
		value = (int)pApplet.green(input.getValue());
	}

	@Override
	public int getValue() {
		return value;
	}
}
